<template>
	<view>
		<fa-navbar title="我的错题列表"></fa-navbar>
		<view class="content">
			<fa-wrong :questions="questions" :judgeOptions="judgeOptions" @refreshQuestion="refreshQuestion"></fa-wrong>
		</view>
	</view>
</template>

<script>
	
	import FaWrong from './components/fa-wrong/fa-wrong.vue';
	export default {
		components:{
			FaWrong
		},
		data() {
			return {
				questions: [{kind:''}],
				judgeOptions:[],
				ids:''
			};
		},
		onLoad(e) {
			this.ids = e.question_ids
			this.getQuestionList();
		},
		methods:{
			refreshQuestion(){
				console.log(2222)
				this.getQuestionList()
			},
			getQuestionList(){
				this.$api.getWrongQuestionList({ids:this.ids}).then((res)=>{
					if(res.code){
						this.questions = res.data
						console.log(res.data.lenght);
						if(res.data.length == 0){
							this.questions.push({kind:''})
						}
					}
				})
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	.content {
		padding-top: 188rpx;
	}

	.container {
		// padding: 0 30rpx 30rpx 30rpx;
		min-height: 100vh;
		background-color: #eaeaea;
		
	}
</style>
